#define  _CRT_SECURE_NO_WARNINGS 1
#include<vector>
#include<iostream>
using namespace std;
vector<vector<int> > subsets(vector<int>& nums) {
    vector<vector<int> > ret;
    int len = nums.size();
    int S = 1 << (len - 1);
    /*vector<int> a;
    ret.push_back(a);*/
    int pos = 0;
    for (int i = 0; i < S; i++)
    {
        vector<int> tmp;
        int j = i;
        
        while (j)
        {
            if (j & 1)
            {
                tmp.push_back(nums[pos]);
            }
            j = j >> 1;
            pos++;
        }
        ret.push_back(tmp);
        pos = 0;
    }
    return ret;
}
int main()
{
    vector<int> nums({1,2,3});
   
    vector<vector<int> > ret = subsets(nums);
    /*for (auto& e : ret)
    {
       
    }*/
    return 0;
}